package cn.cboard.dao;

import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;
import cn.cboard.database.JdbcBuilder;
import cn.cboard.database.Query;

public class JdbcTransactionTest extends TestCase{
	public void testPoolQueryTransaction(){
		Query query = JdbcBuilder.beginPoolQuery();
		query.begin();
		
		List queryParams = new ArrayList();
		queryParams.add("korpton");
		queryParams.add(new Long(1));
		
		StringBuffer sqlquery = new StringBuffer();
		for(int i=0; i<10; i++){
		sqlquery.append("insert into test(name,value) values(?,?);");
		}
		
		try {
			query.queryExecute(queryParams, sqlquery.toString());
		} catch (Exception e) {
			e.printStackTrace();
		}
		query.commit();
		JdbcBuilder.CloseAllConnection();
	}
}
